package com.cqqs.common.exception;

import com.cqqs.common.enums.error.BusinessError;

/**
 * 系统异常
 *
 * @author mjxie
 * @date 2022/09/21
 */
public class SystemException extends RuntimeException implements BusinessError {
    private final int code;

    private final String msg;

    private final String data;

    public SystemException(BusinessError error) {
        super(error.getMsg());
        this.code = error.getCode();
        this.msg = error.getMsg();
        this.data = error.getData();
    }


    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }

    @Override
    public String getData() {
        return this.data;
    }
}
